using System.Collections.Generic;
using System.Collections.Specialized;
using System.Web;

namespace MimeCloud.Foundations.Helpers
{
    public static class DictionaryHelper
    {
        public static IDictionary<string, string> ParsePropertiesString(string propertiesString)
        {
            return ToDictionary(HttpUtility.ParseQueryString(propertiesString));
        }

        public static IDictionary<string, string> ToDictionary(NameValueCollection collection)
        {
            IDictionary<string, string> returnDict = new Dictionary<string, string>();
            foreach (string key in collection)
            {
                returnDict[key] = collection[key];
            }
            return returnDict;
        }
    
    }
}
